<?php
/*
**************************************************************************
*  File: index.php
*  (c) Extreme Portal Light Version 2012-2014
*  By elwizard. All rights reserved.
*  http://www.mgsteam.es
*
*  This program is free software under MGS License Agreement. 
*  You cannot distribute in any way. For modifications, please read 
*  MGS License Agreement for more information.
*
**************************************************************************
*/

// security 
define("IN_WEB", 1);
define("IN_EXT", 1);
$IS_BANNED = 0;

// Filtro contra ataques XSS
$_SERVER['QUERY_STRING'] = str_replace(array('%3C', '%3E', '<', '>'), array('', '', '', ''), $_SERVER['QUERY_STRING']);
$_SERVER['PHP_SELF'] = str_replace(array('%3C', '%3E', '<', '>'), array('', '', '', ''), $_SERVER['PHP_SELF']);

//ob_start("ext_portal");

// read config class
require "include/config.php";

// Reading Vbulletin...
if (!defined('CWD'))
  define('CWD', 'support'); // Sin acabar en /

// VBULLETIN 
require_once('./support/ext_vbulletin.php');

// read database access class
require "include/class_mysql.php";

// read basic functions class
include "include/class_functions.php";

// read template class
require "templates/default/index.php";

// read vBulletin functions class
include "include/VBULLETIN/ext_vb_functions.php";

// IP info
$ipinfo = $ext->check_country();

// Banned?
$IS_BANNED = $ext->check_banned($ipinfo);

// Surfing anonimously?
$IS_PROXIE = $ext->proxie_running($ipinfo);


// Guardamos localización
$ebf->set_board_location('portal/index');


// OPCIONES SEO - URL AMIGABLES // MODO 0 = DESACTIVADO
// index.php?2-Anuncios-y-noticias // MODO 1
// index.php/7-Presentaciones  // MODO 2
//if ($ext->config['SEO_active']) {
$DIRECTED = $ext->friendly_urls();
//}

// Redirecting if banned...
if (($IS_BANNED) || ($IS_PROXIE)) {
  $section = "banned";
 } else {
 	
 	// Home como referencia si no hay módulos a ver
  if (isset($DIRECTED)){ $section = $DIRECTED; } else { $section = "home"; }

  // Comprobamos si el portal está desactivado por reformas
  if (!$ext->config['portal_active']) {
    $section = "disabled";
  }
}

require "options/".$section."/index.php";

?>